﻿<?php
/**
* @version		$Id: view.html.php 9764 2007-12-30 07:48:11Z ircmaxell $
* @package		Joomla
* @subpackage	Poll
* @copyright	Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license		GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');

class amapViewlivraison_par_prodldb extends JView	{
	function display($tpl = null)	{
		$liste_contrats=listecontrats_ouvertsldb();
		//print_r($liste);
		//construction formulaire
		$liste=listeLivraisonsldb();

		echo "<H3 style='color: red; font-weight: bold;'> en cours de dev</H3>";
		echo "<H3>Liste des prochaines livraisons par producteur</h3>";
		echo "<strong>Choisissez le format désiré : </strong><br>";
		
		
		echo "<CENTER><TABLE width='95%'>
				<TR style='background-color: #0096D2; color: white;'>
					<TD width='40%' align='center'><strong>Date</strong></TD>";
		foreach ($liste as $element1)	{
			echo "<TD align='center'><strong>". fdate($element1['Date'])."</strong></TD>";
		}
		echo "</TR>";
		foreach ($liste_contrats as $element)	{
			echo 	"<TR class='amap_beautableau'>
						<TD align='left'><strong style='font-size: 1.1em; padding-left: 10px;'>".$element['Nom']."</strong></TD>";
			foreach ($liste as $element1)	{
							//~ LE PDF EST EN COURS DE DEV
				echo "<TD align='center'>
							<A href='".JURI::root()."index.php/component/amap/?view=liste_livraisonldb&amap_abonnement=".$element['Nom']."&type=tableur&distrib=".$element1['Date']."'><img src='".JURI::root()."components/com_amap/images/icone-xls.png' width='24' style='padding: 5px;'></A>
							<A href='".JURI::root()."index.php/component/amap/?view=liste_livraisonldb&amap_abonnement=".$element['Nom']."&type=html&distrib=".$element1['Date']."'><img src='".JURI::root()."components/com_amap/images/icone-html.png' width='24' style='padding: 5px;'></A>
							<!--<A href='".JURI::root()."index.php/component/amap/?view=liste_livraison_par_prodldb&amap_abonnement=".$element['Nom']."&type=pdf&distrib=".$element1['Date']."'><img src='".JURI::root()."components/com_amap/images/icone-pdf.png' width='24' style='padding: 5px;'></A>-->
						</TD>";
			}
			echo "</TR>";
		}
		
		echo "
			</TR>
			</TABLE></CENTER>";

		parent::display($tpl);
	}	
}
?>
